package com.lifeonwalden.game.mindustry.constant;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.lifeonwalden.game.mindustry.feature.Property;
import com.lifeonwalden.game.mindustry.model.ConveyorProperty;
import com.lifeonwalden.game.mindustry.model.DrillProperty;
import com.lifeonwalden.game.mindustry.model.RecipeItem;
import com.lifeonwalden.game.mindustry.model.TurretProperty;

/**
 * surface unit type
 */
public enum SurfaceType {
    Conveyor("conveyor", false, new ConveyorProperty((short) 200), (short) 100,
            recipeItem(ResourceType.Stone, 1)),
    ConveyorMove("conveyormove", false, null, (short) 100),
    StoneWall("stonewall", true, null, (short) 100,
            recipeItem(ResourceType.Stone, 4)),
    IronWall("ironwall", true, null, (short) 100,
            recipeItem(ResourceType.Iron, 4)),
    Drill("drill", true,
            new DrillProperty((short) 6000, (short) 10), (short) 100,
            recipeItem(ResourceType.Stone, 5)),
    IronDrill("irondrill", true, null, (short) 100,
            recipeItem(ResourceType.Iron, 30)),
    CoalDrill("coaldrill", true, null, (short) 100,
            recipeItem(ResourceType.Stone, 30), recipeItem(ResourceType.Iron, 30)),
    StoneDrill("stonedrill", true, null, (short) 100),
    Turret("turret", true, new TurretProperty((short) 50, (short) 100, (short) 100), (short) 100,
            recipeItem(ResourceType.Stone, 4)),
    SniperTurret("sniperturret", false, null, (short) 100,
            recipeItem(ResourceType.Iron, 15), recipeItem(ResourceType.Steel, 20)),
    ShotgunTurret("shotgunturret", false, null, (short) 100,
            recipeItem(ResourceType.Iron, 10), recipeItem(ResourceType.Steel, 8)),
    MegaHealTurret("megahealturret", false, null, (short) 100,
            recipeItem(ResourceType.Iron, 30), recipeItem(ResourceType.Steel, 30)),
    MachineTurret("machineturret", false, null, (short) 100,
            recipeItem(ResourceType.Stone, 6), recipeItem(ResourceType.Iron, 10)),
    DoubleTurret("doubleturret", false, null, (short) 100,
            recipeItem(ResourceType.Stone, 6)),
    Bullet("bullet", false, null, (short) 100),
    Mech("mech1", true, null, (short) 100),
    Player("player", true, null, (short) 100),
    Base("core", true, null, (short) 100);

    public String textureName;
    public TextureRegion texture;
    public boolean isObstruction;
    public RecipeItem[] buildRecipeItems;
    public Property property;
    public short maxHp;

    SurfaceType(String textureName, boolean isObstruction, Property property, short maxHp, RecipeItem... buildRecipeItems) {
        this.textureName = textureName;
        this.isObstruction = isObstruction;
        this.property = property;
        this.maxHp = maxHp;
        this.buildRecipeItems = buildRecipeItems;
    }

    private static RecipeItem recipeItem(ResourceType resourceType, int amount) {
        return new RecipeItem(resourceType, amount);
    }
}
